package priv.yiyuan.example.composite;

/**
 * 文件系统文件类
 * <p>
 * 叶子节点类
 *
 * @author YiYuan
 * @data 2025/8/27
 * @apoNote
 */
public class File implements FileSystemComponent {

    private String name;

    private long size;

    public File(String name, long size) {
        this.name = name;
        this.size = size;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public long getSize() {
        return this.size;
    }

    @Override
    public void display(String indent) {
        System.out.println(indent + "- File: " + name + " (" + size + "KB)");
    }
}
